import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QApplication
from PyQtFluentWidgets_ui import (
    pushButton,
    lineEdit,
    TitleLabel,
    setTheme,
    Theme,
)


def main():
    app = QApplication(sys.argv)

    # 设置主题为亮色主题，也可以选择Theme.DARK（暗色主题）
    setTheme(Theme.LIGHT)

    window = QWidget()
    window.setWindowTitle("PyQt-Fluent-Widgets示例")
    window.resize(400, 300)

    layout = QVBoxLayout()

    # 创建标题标签
    title_label = TitleLabel("欢迎使用示例程序")
    layout.addWidget(title_label)

    # 创建输入框
    line_edit = LineEdit(window)
    line_edit.setPlaceholderText("请输入内容")
    layout.addWidget(line_edit)

    # 创建按钮
    button = PushButton("点击我", window)
    button.clicked.connect(lambda: print("按钮被点击了，输入内容为:", line_edit.text()))
    layout.addWidget(button)

    window.setLayout(layout)
    window.show()

    sys.exit(app.exec_())


if __name__ == "__main__":
    main()